	function ibwcalc(unitchoice,sex,height){

	var ibw=0;
//convert height to inches
if (unitchoice){
height=height/2.54;
}

//IBW in men  = 51.65 kg + 1.85 kg/inch of height greater than 5 feet
//IBW in women = 48.67 kg + 1.65 kg/inch of height greater than 5 feet.  


// male
if ((sex==1)&&(height>60)) {
ibw = 51.65 + 1.85*(height-60);
}


// female
if ((sex==0)&&(height>60)) {
ibw = 48.67 + 1.65*(height-60);
}

ibw=Math.round(ibw*100)/100;		

//convert back to cm
if (unitchoice){
height=height*2.54;
height=Math.round(height);
}



return {
			 ibw:ibw,
			 height:height
	};		 
}




function ref(){
// display reference
 return "Robinson JD et al. Am J Hosp Pharm. 1983 Jun;40(6):1016-9.";
//document.getElementById('GetReference').innerHTML = reference
}